﻿<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="Lou.Dungeons.WebUI._Default" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <asp:ScriptManager runat="server" ID="sm" />
    <asp:UpdatePanel runat="server" ID="upnlConfig" UpdateMode="Conditional">
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="ddlUnitType1" EventName="SelectedIndexChanged" />
        </Triggers>
        <ContentTemplate>
            <table border="0">
                <tr>
                    <td><asp:Label runat="server" ID="lblUnitType1" Text="Unit type 1" /></td>
                    <td><asp:Label runat="server" ID="lblResearch1" Text="Research unit 1" /></td>
                    <td><asp:Label runat="server" ID="lblUnitType2" Text="Unit type 2" /></td>
                    <td><asp:Label runat="server" ID="lblResearch2" Text="Research unit 1" /></td>
                    <td><asp:Label runat="server" ID="lblRoundTripTime" Text="Roundtrip time" /></td>
                    <td><asp:Label runat="server" ID="lblDungeonType" Text="Dungeon type" /></td>
                </tr>
                <tr>
                    <td><asp:DropDownList runat="server" ID="ddlUnitType1" AutoPostBack="true" OnSelectedIndexChanged="ddlUnitType1_SelectedIndexChanged" /></td>
                    <td><asp:TextBox runat="server" ID="tbResearch1" /></td>
                    <td><asp:DropDownList runat="server" ID="ddlUnitType2" /></td>
                    <td><asp:TextBox runat="server" ID="tbResearch2" /></td>
                    <td><asp:TextBox runat="server" ID="tbRoundTripTime" /></td>
                    <td><asp:DropDownList runat="server" ID="ddlDungeonType" /></td>
                </tr>
                <tr>
                    <td colspan="3"><asp:DropDownList runat="server" ID="ddlBuild" /></td>
                    <td><asp:CheckBox runat="server" ID="cbForceBuild" Text="Force Build" /></td>
                    <td><asp:Button runat="server" ID="btnCalculate" OnClick="btnCalculate_Click" Text="Calculate" /></td>
                </tr>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdatePanel runat="server" ID="upnlResults" UpdateMode="Conditional">
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnCalculate" EventName="Click" />
        </Triggers>
        <ContentTemplate>
            <asp:GridView runat="server" ID="gvResults" AutoGenerateColumns="false" OnRowDataBound="gvResults_RowDataBound">
                <Columns>
                    <asp:BoundField DataField="Ratio" HeaderText="% Unit 1" />
                    <asp:BoundField DataField="BalancePerTS" HeaderText="Balance / TS" />
                    <asp:BoundField DataField="MaxReplaceableTSView" HeaderText="Max replaceable TS" />
                    <asp:BoundField DataField="Build" HeaderText="Build" />
                    <asp:BoundField DataField="TotalWithoutGoldPerHour" HeaderText="Total without gold in k / Hour" />
                    <asp:BoundField DataField="FoodPerHour" HeaderText="Food balance in k / Hour" />
                    <asp:BoundField DataField="IronPerHour" HeaderText="Iron balance in k / Hour" />
                    <asp:BoundField DataField="WoodPerHour" HeaderText="Wood balance in k / Hour" />
                    <asp:BoundField DataField="StonePerHour" HeaderText="Stone balance in k / Hour" />
                    <asp:BoundField DataField="GoldPerHour" HeaderText="Gold balance in k / Hour" />
                </Columns>
            </asp:GridView>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
